const promotionChannel = {
    title: "投稿渠道",
    key: 'promotionChannel',
    types: [
        {
            name: "全部",
            id: null,
        },
        {
            name: "抖音",
            id: 0,
        },
        {
            name: "快手",
            id: 1,
        },
        {
            name: "微信",
            id: 2,
        },
    ],
}
// 收藏/浏览 筛选条件
export const collectFilters = {
    options: [
        promotionChannel,
        {
            title: '结算方式',
            key: 'settleType',
            types: [
                {
                    name: '全部',
                    id: null
                },
                {
                    name: '充值',
                    id: 0,
                },
                {
                    name: '星图',
                    id: 1,
                },
                {
                    name: '聚星',
                    id: 2,
                },
            ]
        },
        {
            title: '上新时间',
            key: 'onlineTime',
            types: [
                {
                    name: '全部',
                    id: null
                },
                {
                    name: '今日',
                    id: 0,
                },
                {
                    name: '近3日',
                    id: 1,
                },
                {
                    name: '近7日',
                    id: 2,
                },
            ]
        },
        {
            title: '排序方式',
            key: 'sortTypeType',
            types: [
                {
                    name: '默认',
                    id: 0,
                    path: '/api/user/video_drama/collect/list/sort_by_recommend',//收藏
                    vpath: '/api/user/video_drama/view/list/sort_by_recommend',//浏览
                    dpath:'/api/video_drama/list/sort_by_recommend',//短剧
                },
                {
                    name: '收益',
                    id: 1,
                    path: '/api/user/video_drama/collect/list/sort_by_income',
                    vpath: '/api/user/video_drama/view/list/sort_by_income',//浏览
                    dpath:'/api/video_drama/list/sort_by_income',//短剧
                },
                {
                    name: '推广数',
                    id: 2,
                    path: '/api/user/video_drama/collect/list/sort_by_promotion_count',
                    vpath: '/api/user/video_drama/view/list/sort_by_promotion_count',//浏览
                    dpath:'/api/video_drama/list/sort_by_promotion_count',//短剧
                },
                {
                    name: '最新',
                    id: 3,
                    path: '/api/user/video_drama/collect/list/sort_by_time',
                    vpath: '/api/user/video_drama/view/list/sort_by_time',//浏览
                    dpath:'/api/video_drama/list/sort_by_time',//短剧
                },
            ]
        }
    ],
    default(pathName = 'path') {
        return [...this.options].map(item => {
            return {
                key: item.key,
                value: item.types[0].id,
                path: item.types[0][pathName] || null
            }
        })
    }
}

// 推广
export const extendsFilters = {
    options: [
        promotionChannel,
        {
            title: '创建时间',
            key: 'createTime',
            types: [
                {
                    name: '全部',
                    id: null
                },
                {
                    name: '今日',
                    id: 0,
                },
                {
                    name: '昨天',
                    id: 1,
                },
                {
                    name: '7日内',
                    id: 7,
                },
                {
                    name: '15日内',
                    id: 15,
                },
                {
                    name: '本月',
                    id: 16,
                },
                {
                    name: '上月',
                    id: 17,
                },
            ]
        },
        {
            title: '排序方式',
            key: 'sortType',
            types: [
                
                {
                    name: '时间最新',
                    id: 0,
                },
                {
                    name: '时间最早',
                    id: 1,
                },
                {
                    name: '收益最多',
                    id: 2,
                },
                {
                    name: '收益少',
                    id: 3,
                },
            ]
        }
    ],
    default() {
        return [...this.options].map(item => {
            return {
                key: item.key,
                value: item.types[0].id,
            }
        })
    }
}